Skip to content

refactor(generator): include commit spaces in generated words (@miodec, @Leonabcd123)#8157

Open
Miodec wants to merge 91 commits into
masterfrom
commit-character-in-generator
Open

refactor(generator): include commit spaces in generated words (@miodec, @Leonabcd123)#8157
Miodec wants to merge 91 commits into
masterfrom
commit-character-in-generator

Conversation

@Miodec

@Miodec Miodec commented Jun 24, 2026

Copy link
Copy Markdown
Member

Reworks the generation to include commit/separation character in the target word.

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Jun 24, 2026
Comment thread frontend/src/ts/elements/caret.ts
@Miodec Miodec changed the title refactor(generator): include commit spaces in generated words (@miodec) refactor(generator): include commit spaces in generated words (@miodec, @Leonabcd123) Jun 24, 2026
Miodec and others added 10 commits June 24, 2026 19:12
Words now carry their commit separator as a trailing space emitted by the
generator (getNextWord) instead of being added retroactively to the previous
word in Words.push. The old retroactive model assumed the next word was always
generated before the current one was committed, which is false for plus_zero
(toPush:1, zero lookahead): the current word was read bare during live
validation, breaking commit, stop-on-error, expert, and quick-end.

- strip prev words inside getNextWord so trailing separators don't leak into
  dedup/punctuation/capitalization feedback
- guard the separator append for nospace mode and newline-terminated words
- strip the trailing separator from the final word once generation is complete,
  covering the bulk, section, and lazy addWord paths (final word stays bare)
- restore the expert-mode guard so a leading separator (empty input) never fails
- move areAllTestWordsGenerated -> areAllWordsGenerated in words-generator

Update test-words/validation/fail-or-finish specs to the new contracts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

Comment on lines +67 to +72
const goingToNextWord = shouldGoToNextWord({
data,
inputValue,
targetWord: currentWordTextWithCommit,
commitCharacterType,
});
Comment thread frontend/src/ts/test/test-ui.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.

Comment thread frontend/src/ts/test/pace-caret.ts
Comment thread frontend/src/ts/test/pace-caret.ts
Comment thread frontend/src/ts/test/test-ui.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.

Comment thread frontend/src/ts/test/test-ui.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.

Comment thread frontend/src/ts/utils/strings.ts
Comment thread frontend/src/ts/test/test-ui.ts Outdated
Comment thread frontend/src/ts/test/test-ui.ts Outdated
Comment thread frontend/src/ts/test/test-ui.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.

Comment thread frontend/src/ts/test/test-ui.ts
Comment thread frontend/src/ts/test/pace-caret.ts
Comment thread frontend/src/ts/test/pace-caret.ts
Comment thread frontend/src/ts/test/pace-caret.ts
@Miodec Miodec marked this pull request as ready for review July 4, 2026 11:55
@Miodec Miodec requested a review from Copilot July 4, 2026 11:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

frontend/src/ts/utils/strings.ts:391

  • isSpace docstring says “directly typable … on a standard keyboard”, but the implementation includes IME/Unicode-only spaces (e.g. U+3000, U+200B). This mismatch can mislead callers about what the predicate actually means.
/**
 * Checks if a character is a directly typable space character on a standard keyboard.
 * These are space characters that can be typed without special input methods or copy-pasting.
 * @param char The character to check.
 * @returns True if the character is a directly typable space, false otherwise.
 */

Comment thread frontend/src/ts/test/test-ui.ts
Comment thread frontend/src/ts/input/helpers/util.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff waiting for review Pull requests that require a review before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants